package org.wz.complex.work.kit.encrypt;

import jakarta.servlet.http.HttpServletRequest;
import org.wz.complex.work.kit.str.StrKit;

public interface TokenKit {

    String TOKEN_HEADER = "Authorization";

    String TOKEN_FLAG = "Bearer Wang-Zhou-Token:";


    public static String hanleToken(HttpServletRequest request) {
        String token = request.getHeader(TOKEN_HEADER);
        if (StrKit.notNull(token) && token.length() > 252) {
            if (token.trim().startsWith(TOKEN_FLAG)) {
                return token.trim().replace(TOKEN_FLAG, "");
            }
            return null;
        }
        return null;
    }

}
